import 'package:lib_common/lib_common.dart';

/// Route 路径
class RoutePaths {
  RoutePaths._();

  // app module
  static const String splash = 'app/splash';
  static const String home = '/home';
  static const String web = '/web';

  static const String appSettings = "/settings";

  static const String agreement = '/agreement';
  static const String agreementList = '/agreement_list';

  // 门店版
  static const String logoutNotice = "/logout_notice";
  static const String adVideo = "/ad_video";
  static const String logout = "/logout";

  // user module
  static const String login = '/login';

  // game module
  static const String gameDetail = "/game_detail";
  static const String gameLoading = "/game_loading";

  // pay module
  static const String rechargeCenter = "/recharge_center";

  // other
  static const String netConfig = '/net_config';
}

Future<dynamic> pushNamed(String path, {dynamic arguments}) {
  return Navigator.of(AppManager.getInstance().context).pushNamed(path, arguments: arguments);
}

void pop({dynamic result}) {
  Navigator.of(AppManager.getInstance().context).pop(result);
}

Future<dynamic> popAndPushNamed(String path, {dynamic arguments}) {
  return Navigator.of(AppManager.getInstance().context).popAndPushNamed(path, arguments: arguments);
}

Future<dynamic> pushNamedAndRemoveUntil(String path, RoutePredicate predicate, {dynamic arguments}) {
  return Navigator.of(AppManager.getInstance().context).pushNamedAndRemoveUntil(path, predicate, arguments: arguments);
}

Future<dynamic> pushReplacementNamed(String path, {dynamic result, dynamic arguments}) {
  return Navigator.of(AppManager.getInstance().context).pushReplacementNamed(path, result: result, arguments: arguments);
}

void removeRoute(Route route) {
  Navigator.of(AppManager.getInstance().context).removeRoute(route);
}
